#
#    Pixel War (Cliente) - Cliente de Juego Multiplayer Online
#    Copyright (C) 2010 - Francisco Rivera
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

from enviar import Enviar
from bloqueos import BloqueoDisp

class Protocolo:
    ''' Clase para el envio de mensajes al servidor '''
    
    def enviarDatos(self, equipo):
        Enviar('dt', [equipo])   

    def enviarOK(self):
        Enviar('ok', [])        
    
    def moverNorte(self):
        Enviar('mv', ['n'])
        
    def moverSur(self):    
        Enviar('mv', ['s'])
        
    def moverOeste(self):
        Enviar('mv', ['o'])
        
    def moverEste(self):
        Enviar('mv', ['e'])
            
    def disparar(self, dir):
        if not BloqueoDisp.block:
            Enviar('dp', [dir])
            BloqueoDisp()
            
    def restartRound(self):
        Enviar('rr', [])